package com.wyh.filemanager.model;

import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;

import com.wyh.filemanager.util.FileUtil;

public class FileInfo {

	public File file;

	public int count;

	public static ArrayList<FileInfo> getChildFiles(String path,
			FileFilter filter) {
		ArrayList<FileInfo> fileInfos = new ArrayList<FileInfo>();
		File[] files = FileUtil.getChildFiles(new File(path), filter);
		FileInfo fileInfo;
		if (files != null) {
			for (File file : files) {
				if (file == null) {
					continue;
				}
				fileInfo = new FileInfo();
				fileInfo.file = file;
				fileInfos.add(fileInfo);
			}
		}
		return fileInfos;
	}

}
